<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 * @version    $Id: Controller.php 2010-08-31 16:05 idris $
 * @author     Idris
 */

/**
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 */

class Page_Widget_SearchController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
		$this->view->subject = $subject = Engine_Api::_()->core()->getSubject('page');
		$table = Engine_Api::_()->getDbTable('modules', 'core');
		$db = $table->getAdapter();

    $prefix = $table->getTablePrefix();

    $select = $db->select()->from($prefix.'page_modules');
    $modules = $db->fetchAll($select);

		$enabledModules = array();
		foreach ($modules as $module){
	    if (!$table->isModuleEnabled($module['name'])) continue ;
			$enabledModules[$module['name']] = 1;
    }

		$this->view->enabledModules = $enabledModules;

		$this->view->labels = array(
			'pagealbum' => 'Photos',
			'pagevideo' => 'Videos',
			'pageblog' => 'Blogs',
			'pagemusic' => 'Music'
		);

		$this->getElement()->setTitle('');
  }
}